package day019.ioStream;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class PropertiesDemo3 {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.setProperty("zhangsan1", "23");
        properties.setProperty("lisi1", "24");
        properties.setProperty("wangwu", "25");

        properties.store(new FileOutputStream("D:\\ideaProjects\\javase_code\\study-practice\\" +
                "src\\day019\\ioStream\\day019_demo\\test7.txt"), "userMessage");

        method();
    }

    private static void method() throws IOException {
        Properties properties = new Properties();

        properties.load(new FileInputStream("D:\\ideaProjects\\javase_code\\study-practice\\" +
                "src\\day019\\ioStream\\day019_demo\\test7.txt"));

        System.out.println(properties);
    }
}
